package cn.wsalix.weixin.req.entity;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;

import cn.wsalix.weixin.entity.BaseMsg;
import cn.wsalix.weixin.message.req.ReqType;
import cn.wsalix.weixin.util.XStreamCDataConverter;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "WX_REQ_BASE_EVENT")
@Inheritance(strategy = InheritanceType.JOINED)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@EntityListeners({ AuditingEntityListener.class })
public class BaseEvent extends BaseMsg{
    /**
	 * 
	 */
	private static final long serialVersionUID = -692157347338785876L;
	@XStreamAlias("Event")
	@XStreamConverter(value = XStreamCDataConverter.class)
	private String event;

    public BaseEvent() {
        setMsgType(ReqType.EVENT);
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }
   
}
